home *** CD-ROM | disk | FTP | other *** search
- From: envbvs@epb2.lbl.gov (Brian V. Smith)
- Newsgroups: comp.sources.x
- Subject: v06i083: xfig 2.0, Patch6, Part03/06
- Message-ID: <134789@sun.Eng.Sun.COM>
- Date: 24 Apr 90 22:25:49 GMT
- Approved: argv@sun.com
-
- Submitted-by: envbvs@epb2.lbl.gov (Brian V. Smith)
- Posting-number: Volume 6, Issue 83
- Archive-name: xfig2/patch6.3
- Patch-To: xfig2: Volume 6, Issues: 9-24, 34-36, 50-56
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 3 (of 6)."
- # Contents: bitmap.c.diff draw.c.diff movept.c.diff psfonts.c.diff
- # read.c.diff ruler.c.diff text.c.diff xtra.c.diff
- # Wrapped by envbvs@epb2.lbl.gov on Tue Apr 24 11:56:46 1990
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'bitmap.c.diff' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'bitmap.c.diff'\"
- else
- echo shar: Extracting \"'bitmap.c.diff'\" \(6404 characters\)
- sed "s/^X//" >'bitmap.c.diff' <<'END_OF_FILE'
- X*** bitmap.c.old Tue Apr 24 11:48:07 1990
- X--- bitmap.c Wed Apr 18 09:16:07 1990
- X***************
- X*** 12,17 ****
- X--- 12,18 ----
- X #include "object.h"
- X #include "paintop.h"
- X
- X+ extern int CANVAS_WIDTH, CANVAS_HEIGHT;
- X extern F_compound objects;
- X
- X extern int errno;
- X***************
- X*** 24,30 ****
- X
- X write_bitmap(file_name)
- X char *file_name;
- X! {
- X FILE *fp;
- X struct stat file_status;
- X char string[180];
- X--- 25,31 ----
- X
- X write_bitmap(file_name)
- X char *file_name;
- X! {
- X FILE *fp;
- X struct stat file_status;
- X char string[180];
- X***************
- X*** 45,51 ****
- X }
- X else {
- X sprintf(string, "\"%s\" File exists. Please click the LEFT button to COMFIRM overwrite. To cancel, click the MIDDLE or RIGHT button.", file_name);
- X! if (wmgr_confirm(canvas_swfd, string) != -1) {
- X put_msg("No write.");
- X return;
- X }
- X--- 46,52 ----
- X }
- X else {
- X sprintf(string, "\"%s\" File exists. Please click the LEFT button to COMFIRM overwrite. To cancel, click the MIDDLE or RIGHT button.", file_name);
- X! if (wmgr_confirm(canvas_win, string) != -1) {
- X put_msg("No write.");
- X return;
- X }
- X***************
- X*** 56,80 ****
- X return;
- X }
- X }
- X! else if (errno != ENOENT) return; /* file does exist but stat fails */
- X
- X! if ((fp = fopen(file_name, "w")) == NULL) {
- X! blink_msg();
- X! put_msg("Couldn't open file %s, %s", file_name, sys_errlist[errno]);
- X! return;
- X! }
- X! else {
- X! create_n_write_bitmap(fp);
- X! }
- X }
- X
- X! create_n_write_bitmap(fp)
- X! FILE *fp;
- X! {
- X! int box, marker, xmin, ymin, xmax, ymax;
- X! PIXRECT bitmap, pw_pixrect, pw_prretained;
- X! F_text *t;
- X
- X /* Assume that there is at least one object */
- X compound_bound(&objects, &xmin, &ymin, &xmax, &ymax);
- X
- X--- 57,88 ----
- X return;
- X }
- X }
- X! else if (errno != ENOENT) /* file does exist but stat fails */
- X! return;
- X
- X! create_n_write_bitmap(file_name); /* write the bitmap file */
- X }
- X
- X! static Boolean havegcs = False;
- X! static GC sav_fill_gc[NUMFILLPATS];
- X! static GC sav_un_fill_gc[NUMFILLPATS];
- X! static unsigned long save_fg_color;
- X! static unsigned long save_bg_color;
- X
- X+ create_n_write_bitmap(filename)
- X+ char *filename;
- X+ {
- X+ int box, marker, xmin, ymin, xmax, ymax;
- X+ int width, height;
- X+ Window sav_canvas, oneplane_win;
- X+ int sav_pointmarker_shown;
- X+ Pixmap largepm,bitmap;
- X+ extern F_compound objects;
- X+ XVisualInfo *visual,vinfo_template,*vis;
- X+ long vinfo_mask;
- X+ int nitems,i;
- X+ GC xgc;
- X+
- X /* Assume that there is at least one object */
- X compound_bound(&objects, &xmin, &ymin, &xmax, &ymax);
- X
- X***************
- X*** 81,86 ****
- X if (appres.DEBUG) {
- X draw_rectbox(xmin, ymin, xmax, ymax, INV_PAINT);
- X }
- X- put_msg("Sorry, write_bitmap not implemented for X11 yet");
- X- }
- X
- X--- 89,182 ----
- X if (appres.DEBUG) {
- X draw_rectbox(xmin, ymin, xmax, ymax, INV_PAINT);
- X }
- X
- X+ /* provide a small margin */
- X+ if ((xmin -= 10) < 0)
- X+ xmin = 0;
- X+ if ((ymin -= 10) < 0)
- X+ ymin = 0;
- X+ if ((xmax += 10) > CANVAS_WIDTH)
- X+ xmax = CANVAS_WIDTH;
- X+ if ((ymax += 10) > CANVAS_HEIGHT)
- X+ ymax = CANVAS_HEIGHT;
- X+
- X+ width = xmax-xmin+1;
- X+ height = ymax-ymin+1;
- X+
- X+ /* choose foreground/background colors as 1 and 0 respectively */
- X+ /* that way we can just copy the lowest plane to make the bitmap */
- X+
- X+ XSetPlaneMask(tool_d, gccache[PAINT], (unsigned long) 1);
- X+ XSetForeground(tool_d, gccache[PAINT], (unsigned long) 1);
- X+ XSetBackground(tool_d, gccache[PAINT], (unsigned long) 0);
- X+ XSetPlaneMask(tool_d, gccache[ERASE], (unsigned long) 1);
- X+ XSetForeground(tool_d, gccache[ERASE], (unsigned long) 0);
- X+ XSetBackground(tool_d, gccache[ERASE], (unsigned long) 0);
- X+ save_fg_color = x_fg_color.pixel; /* save current colors */
- X+ save_bg_color = x_bg_color.pixel;
- X+ x_fg_color.pixel = 1; /* set fore=1, back=0 */
- X+ x_bg_color.pixel = 0;
- X+ if (!havegcs)
- X+ {
- X+ havegcs = True;
- X+ for (i=0; i<NUMFILLPATS; i++) /* save current fill gc's */
- X+ {
- X+ sav_fill_gc[i] = fill_gc[i];
- X+ sav_un_fill_gc[i] = un_fill_gc[i];
- X+ }
- X+ init_fill_gc(); /* make some with 0/1 for colors */
- X+ }
- X+ else
- X+ for (i=0; i<NUMFILLPATS; i++)
- X+ {
- X+ xgc = sav_fill_gc[i]; /* swap our gc's with orig */
- X+ sav_fill_gc[i] = fill_gc[i];
- X+ fill_gc[i] = xgc;
- X+ xgc = sav_un_fill_gc[i];
- X+ sav_un_fill_gc[i] = un_fill_gc[i];
- X+ un_fill_gc[i] = xgc;
- X+ }
- X+
- X+ /* create pixmap from (0,0) to (xmax,ymax) */
- X+ largepm = XCreatePixmap(tool_d, canvas_win, xmax+1, ymax+1,
- X+ DefaultDepthOfScreen(tool_s));
- X+ /* clear it */
- X+ XFillRectangle(tool_d, largepm, gccache[ERASE], xmin,ymin,width,height);
- X+ sav_canvas = canvas_win; /* save current canvas window id */
- X+ canvas_win = largepm; /* make the canvas our pixmap */
- X+ sav_pointmarker_shown = pointmarker_shown; /* save the point marker */
- X+ pointmarker_shown = False;
- X+ redisplay_objects(&objects); /* draw the figure into the pixmap */
- X+ XFlush(tool_d);
- X+ canvas_win = sav_canvas; /* go back to the real canvas */
- X+ pointmarker_shown = sav_pointmarker_shown; /* restore point marker */
- X+ bitmap = XCreatePixmap(tool_d, canvas_win, width, height,
- X+ DefaultDepthOfScreen(tool_s));
- X+ /* now copy one plane of the pixmap to a bitmap of the correct size */
- X+ XCopyPlane(tool_d, largepm, bitmap, gccache[PAINT],
- X+ xmin, ymin, width, height, 0, 0, 1);
- X+ x_fg_color.pixel = save_fg_color; /* put colors back to normal */
- X+ x_bg_color.pixel = save_bg_color;
- X+ XSetPlaneMask(tool_d, gccache[PAINT], (unsigned long) AllPlanes);
- X+ XSetForeground(tool_d, gccache[PAINT], x_fg_color.pixel);
- X+ XSetBackground(tool_d, gccache[PAINT], x_bg_color.pixel);
- X+ XSetPlaneMask(tool_d, gccache[ERASE], (unsigned long) AllPlanes);
- X+ XSetForeground(tool_d, gccache[ERASE], x_bg_color.pixel);
- X+ XSetBackground(tool_d, gccache[ERASE], x_bg_color.pixel);
- X+ for (i=0; i<NUMFILLPATS; i++) /* swap back the fill gc's */
- X+ {
- X+ xgc = sav_fill_gc[i];
- X+ sav_fill_gc[i] = fill_gc[i];
- X+ fill_gc[i] = xgc;
- X+ xgc = sav_un_fill_gc[i];
- X+ sav_un_fill_gc[i] = un_fill_gc[i];
- X+ un_fill_gc[i] = xgc;
- X+ }
- X+ if (XWriteBitmapFile(tool_d, filename, bitmap, width, height, -1, -1)
- X+ != BitmapSuccess)
- X+ put_msg("Couldn't write bitmap file");
- X+ else
- X+ put_msg("Bitmap written to %s",filename);
- X+ XFreePixmap(tool_d, largepm);
- X+ XFreePixmap(tool_d, bitmap);
- X+ }
- END_OF_FILE
- if test 6404 -ne `wc -c <'bitmap.c.diff'`; then
- echo shar: \"'bitmap.c.diff'\" unpacked with wrong size!
- fi
- # end of 'bitmap.c.diff'
- fi
- if test -f 'draw.c.diff' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'draw.c.diff'\"
- else
- echo shar: Extracting \"'draw.c.diff'\" \(4937 characters\)
- sed "s/^X//" >'draw.c.diff' <<'END_OF_FILE'
- X*** draw.c.old Tue Apr 24 11:48:13 1990
- X--- draw.c Mon Apr 16 11:24:55 1990
- X***************
- X*** 13,20 ****
- X
- X extern int pointmarker_shown, compoundbox_shown;
- X extern int background_color, foreground_color;
- X- extern int radius;
- X- extern PIXRECTREC dot;
- X
- X /* COMMENTED OUT
- X erase_objects(objects)
- X--- 13,18 ----
- X***************
- X*** 197,205 ****
- X y = yb + wid / 2;
- X xd = x*cosa + y*sina + .5;
- X yd = -x*sina + y*cosa + .5;
- X! pw_vector(canvas_pixwin, xc, yc, x2, y2, op,
- X (int) arrow->thickness, arrow->style, 0.0);
- X! pw_vector(canvas_pixwin, xd, yd, x2, y2, op,
- X (int) arrow->thickness, arrow->style, 0.0);
- X }
- X
- X--- 195,203 ----
- X y = yb + wid / 2;
- X xd = x*cosa + y*sina + .5;
- X yd = -x*sina + y*cosa + .5;
- X! pw_vector(canvas_win, xc, yc, x2, y2, op,
- X (int) arrow->thickness, arrow->style, 0.0);
- X! pw_vector(canvas_win, xd, yd, x2, y2, op,
- X (int) arrow->thickness, arrow->style, 0.0);
- X }
- X
- X***************
- X*** 286,292 ****
- X x = point->x;
- X y = point->y;
- X if (line->points->next == NULL) { /* A single point */
- X! XDrawPoint(tool_d, canvas_pixwin, gccache[op], x, y);
- X return;
- X }
- X if (line->back_arrow) /* backward arrow */
- X--- 284,290 ----
- X x = point->x;
- X y = point->y;
- X if (line->points->next == NULL) { /* A single point */
- X! XDrawPoint(tool_d, canvas_win, gccache[op], x, y);
- X return;
- X }
- X if (line->back_arrow) /* backward arrow */
- X***************
- X*** 316,322 ****
- X else /* draw dashed or dotted line segment by segment
- X otherwise when moving one segment later there
- X is an alignment problem with the dashes */
- X! pw_vector(canvas_pixwin, x, y, point->x, point->y, op,
- X line->thickness, line->style, line->style_val);
- X xx = x; yy = y;
- X x = point->x;
- X--- 314,320 ----
- X else /* draw dashed or dotted line segment by segment
- X otherwise when moving one segment later there
- X is an alignment problem with the dashes */
- X! pw_vector(canvas_win, x, y, point->x, point->y, op,
- X line->thickness, line->style, line->style_val);
- X xx = x; yy = y;
- X x = point->x;
- X***************
- X*** 324,330 ****
- X }
- X if (line->style == SOLID_LINE)
- X {
- X! pw_lines(canvas_pixwin, points, npoints, op,
- X line->thickness, line->style, line->style_val, 0);
- X free(points);
- X }
- X--- 322,328 ----
- X }
- X if (line->style == SOLID_LINE)
- X {
- X! pw_lines(canvas_win, points, npoints, op,
- X line->thickness, line->style, line->style_val, 0);
- X free(points);
- X }
- X***************
- X*** 338,347 ****
- X {
- X F_point *point;
- X int xmin,xmax,ymin,ymax;
- X! int pop, thick, style;
- X float val;
- X int radius,diam;
- X- XGCValues gcv;
- X GC gc;
- X
- X thick = line->thickness;
- X--- 336,344 ----
- X {
- X F_point *point;
- X int xmin,xmax,ymin,ymax;
- X! int thick, style;
- X float val;
- X int radius,diam;
- X GC gc;
- X
- X thick = line->thickness;
- X***************
- X*** 350,357 ****
- X point = line->points;
- X style = line->style;
- X val = line->style_val;
- X! radius = line->pen; /* hopefully temporary */
- X! pop = (op == ERASE)? background_color: foreground_color;
- X
- X xmin = xmax = point->x;
- X ymin = ymax = point->y;
- X--- 347,353 ----
- X point = line->points;
- X style = line->style;
- X val = line->style_val;
- X! radius = line->radius;
- X
- X xmin = xmax = point->x;
- X ymin = ymax = point->y;
- X***************
- X*** 370,385 ****
- X set_line_stuff(thick,style,val,op);
- X gc = gccache[op];
- X diam = 2*radius;
- X! XDrawArc(tool_d, canvas_pixwin, gc, xmin, ymin,
- X diam, diam, 90*64, 90*64);
- X! XDrawLine(tool_d, canvas_pixwin, gc, xmin, ymin+radius, xmin, ymax-radius+1);
- X! XDrawArc(tool_d, canvas_pixwin, gc, xmin, ymax-diam,
- X diam, diam, 180*64, 90*64);
- X! XDrawLine(tool_d, canvas_pixwin, gc, xmin+radius, ymax, xmax-radius+1, ymax);
- X! XDrawArc(tool_d, canvas_pixwin, gc, xmax-diam, ymax-diam,
- X diam, diam, 270*64, 90*64);
- X! XDrawLine(tool_d, canvas_pixwin, gc, xmax, ymax-radius, xmax, ymin+radius-1);
- X! XDrawArc(tool_d, canvas_pixwin, gc, xmax-diam, ymin,
- X diam, diam, 0*64, 90*64);
- X! XDrawLine(tool_d, canvas_pixwin, gc, xmax-radius, ymin, xmin+radius-1, ymin);
- X }
- X--- 366,381 ----
- X set_line_stuff(thick,style,val,op);
- X gc = gccache[op];
- X diam = 2*radius;
- X! XDrawArc(tool_d, canvas_win, gc, xmin, ymin,
- X diam, diam, 90*64, 90*64);
- X! XDrawLine(tool_d, canvas_win, gc, xmin, ymin+radius, xmin, ymax-radius+1);
- X! XDrawArc(tool_d, canvas_win, gc, xmin, ymax-diam,
- X diam, diam, 180*64, 90*64);
- X! XDrawLine(tool_d, canvas_win, gc, xmin+radius, ymax, xmax-radius+1, ymax);
- X! XDrawArc(tool_d, canvas_win, gc, xmax-diam, ymax-diam,
- X diam, diam, 270*64, 90*64);
- X! XDrawLine(tool_d, canvas_win, gc, xmax, ymax-radius, xmax, ymin+radius-1);
- X! XDrawArc(tool_d, canvas_win, gc, xmax-diam, ymin,
- X diam, diam, 0*64, 90*64);
- X! XDrawLine(tool_d, canvas_win, gc, xmax-radius, ymin, xmin+radius-1, ymin);
- X }
- END_OF_FILE
- if test 4937 -ne `wc -c <'draw.c.diff'`; then
- echo shar: \"'draw.c.diff'\" unpacked with wrong size!
- fi
- # end of 'draw.c.diff'
- fi
- if test -f 'movept.c.diff' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'movept.c.diff'\"
- else
- echo shar: Extracting \"'movept.c.diff'\" \(4775 characters\)
- sed "s/^X//" >'movept.c.diff' <<'END_OF_FILE'
- X*** movept.c.old Tue Apr 24 11:48:21 1990
- X--- movept.c Mon Apr 16 11:22:13 1990
- X***************
- X*** 171,177 ****
- X }
- X cur_e = ellipse;
- X set_temp_cursor(&crosshair_cursor);
- X! win_setmouseposition(canvas_swfd, cur_x, cur_y);
- X canvas_middlebut_proc = fix_movedellipsepoint;
- X canvas_leftbut_proc = null_proc;
- X }
- X--- 171,177 ----
- X }
- X cur_e = ellipse;
- X set_temp_cursor(&crosshair_cursor);
- X! win_setmouseposition(canvas_win, cur_x, cur_y);
- X canvas_middlebut_proc = fix_movedellipsepoint;
- X canvas_leftbut_proc = null_proc;
- X }
- X***************
- X*** 279,285 ****
- X last_position.x = cur_x = arc->point[movedpoint_num].x;
- X last_position.y = cur_y = arc->point[movedpoint_num].y;
- X set_temp_cursor(&crosshair_cursor);
- X! win_setmouseposition(canvas_swfd, cur_x, cur_y);
- X draw_arclink(INV_PAINT);
- X canvas_locmove_proc = move_arcpoint;
- X canvas_middlebut_proc = fix_movedarcpoint;
- X--- 279,285 ----
- X last_position.x = cur_x = arc->point[movedpoint_num].x;
- X last_position.y = cur_y = arc->point[movedpoint_num].y;
- X set_temp_cursor(&crosshair_cursor);
- X! win_setmouseposition(canvas_win, cur_x, cur_y);
- X draw_arclink(INV_PAINT);
- X canvas_locmove_proc = move_arcpoint;
- X canvas_middlebut_proc = fix_movedarcpoint;
- X***************
- X*** 299,315 ****
- X {
- X switch (movedpoint_num) {
- X case 0 :
- X! pw_vector(canvas_pixwin, cur_x, cur_y,
- X arc->point[1].x, arc->point[1].y, op, 1, SOLID_LINE, 0.0);
- X break;
- X case 1 :
- X! pw_vector(canvas_pixwin, arc->point[0].x, arc->point[0].y,
- X cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X! pw_vector(canvas_pixwin, arc->point[2].x, arc->point[2].y,
- X cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X break;
- X default :
- X! pw_vector(canvas_pixwin, arc->point[2].x, arc->point[2].y,
- X cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X }
- X }
- X--- 299,315 ----
- X {
- X switch (movedpoint_num) {
- X case 0 :
- X! pw_vector(canvas_win, cur_x, cur_y,
- X arc->point[1].x, arc->point[1].y, op, 1, SOLID_LINE, 0.0);
- X break;
- X case 1 :
- X! pw_vector(canvas_win, arc->point[0].x, arc->point[0].y,
- X cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X! pw_vector(canvas_win, arc->point[2].x, arc->point[2].y,
- X cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X break;
- X default :
- X! pw_vector(canvas_win, arc->point[2].x, arc->point[2].y,
- X cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X }
- X }
- X***************
- X*** 368,374 ****
- X last_position.x = cur_x = moved_point->x;
- X last_position.y = cur_y = moved_point->y;
- X set_temp_cursor(&crosshair_cursor);
- X! win_setmouseposition(canvas_swfd, cur_x, cur_y);
- X if (closed_spline(s) && left_point == NULL) {
- X for (left_point = moved_point->next,
- X p = left_point->next;
- X--- 368,374 ----
- X last_position.x = cur_x = moved_point->x;
- X last_position.y = cur_y = moved_point->y;
- X set_temp_cursor(&crosshair_cursor);
- X! win_setmouseposition(canvas_win, cur_x, cur_y);
- X if (closed_spline(s) && left_point == NULL) {
- X for (left_point = moved_point->next,
- X p = left_point->next;
- X***************
- X*** 449,455 ****
- X last_position.x = cur_x = moved_point->x;
- X last_position.y = cur_y = moved_point->y;
- X set_temp_cursor(&crosshair_cursor);
- X! win_setmouseposition(canvas_swfd, cur_x, cur_y);
- X switch (line->type) {
- X case T_POLYGON :
- X if (left_point == NULL)
- X--- 449,455 ----
- X last_position.x = cur_x = moved_point->x;
- X last_position.y = cur_y = moved_point->y;
- X set_temp_cursor(&crosshair_cursor);
- X! win_setmouseposition(canvas_win, cur_x, cur_y);
- X switch (line->type) {
- X case T_POLYGON :
- X if (left_point == NULL)
- X***************
- X*** 610,616 ****
- X latexarrow_mode, (magnet_mode)? 5: 1);
- X if (cur_latexcursor != &crosshair_cursor)
- X set_temp_cursor(&crosshair_cursor);
- X! win_setmouseposition(canvas_swfd, x, y);
- X new_position.x = x;
- X new_position.y = y;
- X clean_up();
- X--- 610,616 ----
- X latexarrow_mode, (magnet_mode)? 5: 1);
- X if (cur_latexcursor != &crosshair_cursor)
- X set_temp_cursor(&crosshair_cursor);
- X! win_setmouseposition(canvas_win, x, y);
- X new_position.x = x;
- X new_position.y = y;
- X clean_up();
- X***************
- X*** 652,662 ****
- X F_point *p;
- X
- X if (left_point != NULL) {
- X! pw_vector(canvas_pixwin, left_point->x, left_point->y,
- X cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X }
- X if ((p = moved_point->next) != NULL) {
- X! pw_vector(canvas_pixwin, p->x, p->y, cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X }
- X }
- X
- X--- 652,662 ----
- X F_point *p;
- X
- X if (left_point != NULL) {
- X! pw_vector(canvas_win, left_point->x, left_point->y,
- X cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X }
- X if ((p = moved_point->next) != NULL) {
- X! pw_vector(canvas_win, p->x, p->y, cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X }
- X }
- X
- END_OF_FILE
- if test 4775 -ne `wc -c <'movept.c.diff'`; then
- echo shar: \"'movept.c.diff'\" unpacked with wrong size!
- fi
- # end of 'movept.c.diff'
- fi
- if test -f 'psfonts.c.diff' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'psfonts.c.diff'\"
- else
- echo shar: Extracting \"'psfonts.c.diff'\" \(4525 characters\)
- sed "s/^X//" >'psfonts.c.diff' <<'END_OF_FILE'
- X*** psfonts.c.old Tue Apr 24 11:48:34 1990
- X--- psfonts.c Wed Apr 11 09:20:20 1990
- X***************
- X*** 7,48 ****
- X
- X #ifndef TFX
- X struct _fstruct fontnames[NUMFONTS] = {
- X! {"Times-Roman", "-adobe-times-medium-r-*--*", NULL},
- X! {"Times-Italic", "-adobe-times-medium-i-*--*", NULL},
- X! {"Times-Bold", "-adobe-times-bold-r-*--*", NULL},
- X! {"Times-BoldItalic", "-adobe-times-bold-i-*--*", NULL},
- X! {"AvantGarde-Book", "NONE", NULL},
- X! {"AvantGarde-BookOblique", "NONE", NULL},
- X! {"AvantGarde-Demi", "NONE", NULL},
- X! {"AvantGarde-DemiOblique", "NONE", NULL},
- X! {"Bookman-Light", "NONE", NULL},
- X! {"Bookman-LightItalic", "NONE", NULL},
- X! {"Bookman-Demi", "NONE", NULL},
- X! {"Bookman-DemiItalic", "NONE", NULL},
- X! {"Courier", "-adobe-courier-medium-r-*--*", NULL},
- X! {"Courier-Oblique", "-adobe-courier-medium-o-*--*", NULL},
- X! {"Courier-Bold", "-adobe-courier-bold-r-*--*", NULL},
- X! {"Courier-BoldOblique", "-adobe-courier-bold-o-*--*", NULL},
- X! {"Helvetica", "-adobe-helvetica-medium-r-*--*", NULL},
- X! {"Helvetica-Oblique", "-adobe-helvetica-medium-o-*--*", NULL},
- X! {"Helvetica-Bold", "-adobe-helvetica-bold-r-*--*", NULL},
- X! {"Helvetica-BoldOblique", "-adobe-helvetica-bold-o-*--*", NULL},
- X! {"Helvetica-Narrow", "NONE", NULL},
- X! {"Helvetica-Narrow-Oblique", "NONE", NULL},
- X! {"Helvetica-Narrow-Bold", "NONE", NULL},
- X! {"Helvetica-Narrow-BoldOblique", "NONE", NULL},
- X! {"NewCenturySchlbk-Roman", "-adobe-new century schoolbook-medium-r-*--*", NULL},
- X! {"NewCenturySchlbk-Italic", "-adobe-new century schoolbook-medium-i-*--*", NULL},
- X! {"NewCenturySchlbk-Bold", "-adobe-new century schoolbook-bold-r-*--*", NULL},
- X! {"NewCenturySchlbk-BoldItalic", "-adobe-new century schoolbook-bold-i-*--*", NULL},
- X! {"Palatino-Roman", "NONE", NULL},
- X! {"Palatino-Italic", "NONE", NULL},
- X! {"Palatino-Bold", "NONE", NULL},
- X! {"Palatino-BoldItalic", "NONE", NULL},
- X! {"Symbol", "*-symbol-medium-r-*--*", NULL},
- X! {"ZapfChancery-MediumItalic", "-*-zapfchancery-medium-i-*--*", NULL},
- X! {"ZapfDingbats", "-*-zapfdingbats-*-*-*--*", NULL},
- X! };
- X #else
- X struct _fstruct fontnames[NUMFONTS] = {
- X {"Default", "-adobe-times-medium-r-*--*", NULL},
- X--- 7,48 ----
- X
- X #ifndef TFX
- X struct _fstruct fontnames[NUMFONTS] = {
- X! {"Times-Roman", "-adobe-times-medium-r-*--*", NULL},
- X! {"Times-Italic", "-adobe-times-medium-i-*--*", NULL},
- X! {"Times-Bold", "-adobe-times-bold-r-*--*", NULL},
- X! {"Times-BoldItalic", "-adobe-times-bold-i-*--*", NULL},
- X! {"AvantGarde-Book", "-schumacher-clean-medium-r-*--*", NULL} ,
- X! {"AvantGarde-BookOblique", "-schumacher-clean-medium-i-*--*", NULL} ,
- X! {"AvantGarde-Demi", "-schumacher-clean-bold-r-*--*", NULL},
- X! {"AvantGarde-DemiOblique", "-schumacher-clean-bold-i-*--*", NULL},
- X! {"Bookman-Light", "NONE", NULL},
- X! {"Bookman-LightItalic", "NONE", NULL},
- X! {"Bookman-Demi", "NONE", NULL},
- X! {"Bookman-DemiItalic", "NONE", NULL},
- X! {"Courier", "-adobe-courier-medium-r-*--*", NULL},
- X! {"Courier-Oblique", "-adobe-courier-medium-o-*--*", NULL},
- X! {"Courier-Bold", "-adobe-courier-bold-r-*--*", NULL},
- X! {"Courier-BoldOblique", "-adobe-courier-bold-o-*--*", NULL},
- X! {"Helvetica", "-adobe-helvetica-medium-r-*--*", NULL},
- X! {"Helvetica-Oblique", "-adobe-helvetica-medium-o-*--*", NULL},
- X! {"Helvetica-Bold", "-adobe-helvetica-bold-r-*--*", NULL},
- X! {"Helvetica-BoldOblique", "-adobe-helvetica-bold-o-*--*", NULL},
- X! {"Helvetica-Narrow", "NONE", NULL},
- X! {"Helvetica-Narrow-Oblique", "NONE", NULL},
- X! {"Helvetica-Narrow-Bold", "NONE", NULL},
- X! {"Helvetica-Narrow-BoldOblique","NONE", NULL},
- X! {"NewCenturySchlbk-Roman", "-adobe-new century schoolbook-medium-r-*--*", NULL},
- X! {"NewCenturySchlbk-Italic", "-adobe-new century schoolbook-medium-i-*--*", NULL},
- X! {"NewCenturySchlbk-Bold", "-adobe-new century schoolbook-bold-r-*--*", NULL},
- X! {"NewCenturySchlbk-BoldItalic", "-adobe-new century schoolbook-bold-i-*--*", NULL},
- X! {"Palatino-Roman", "-*-lucidabright-medium-r-*--*", NULL},
- X! {"Palatino-Italic", "-*-lucidabright-medium-i-*--*", NULL},
- X! {"Palatino-Bold", "-*-lucidabright-demibold-r-*--*", NULL} ,
- X! {"Palatino-BoldItalic", "-*-lucidabright-demibold-i-*--*", NULL} ,
- X! {"Symbol", "*-symbol-medium-r-*--*", NULL},
- X! {"ZapfChancery-MediumItalic", "-*-zapfchancery-medium-i-*--*", NULL},
- X! {"ZapfDingbats", "-*-zapfdingbats-*-*-*--*", NULL},
- X! };
- X #else
- X struct _fstruct fontnames[NUMFONTS] = {
- X {"Default", "-adobe-times-medium-r-*--*", NULL},
- END_OF_FILE
- if test 4525 -ne `wc -c <'psfonts.c.diff'`; then
- echo shar: \"'psfonts.c.diff'\" unpacked with wrong size!
- fi
- # end of 'psfonts.c.diff'
- fi
- if test -f 'read.c.diff' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'read.c.diff'\"
- else
- echo shar: Extracting \"'read.c.diff'\" \(6773 characters\)
- sed "s/^X//" >'read.c.diff' <<'END_OF_FILE'
- X*** read.c.old Tue Apr 24 11:48:35 1990
- X--- read.c Wed Apr 18 15:36:48 1990
- X***************
- X*** 25,33 ****
- X
- X #define BUF_SIZE 1024
- X
- X! char buf[BUF_SIZE];
- X! int line_no;
- X! int num_object;
- X
- X read_fail_message(file, err)
- X char *file;
- X--- 25,34 ----
- X
- X #define BUF_SIZE 1024
- X
- X! char buf[BUF_SIZE];
- X! int line_no;
- X! int num_object;
- X! int proto; /* file protocol*10 */
- X
- X read_fail_message(file, err)
- X char *file;
- X***************
- X*** 37,44 ****
- X--- 38,47 ----
- X
- X if (err == 0) /* Successful read */
- X return;
- X+ #ifdef ENAMETOOLONG
- X else if (err == ENAMETOOLONG)
- X put_msg("File name \"%s\" is too long", file);
- X+ #endif
- X else if (err == ENOENT)
- X put_msg("File \"%s\" does not exist", file);
- X else if (err == ENOTDIR)
- X***************
- X*** 89,102 ****
- X FILE *fp;
- X F_compound *obj;
- X {
- X! float vers;
- X! int status;
- X
- X num_object = 0;
- X- if (fgets(buf,BUF_SIZE,fp)==0) /* version if anyone is interested */
- X- return -2;
- X bzero((char*)obj, COMOBJ_SIZE);
- X! status = read_objects(fp, obj);
- X fclose(fp);
- X return(status);
- X }
- X--- 92,118 ----
- X FILE *fp;
- X F_compound *obj;
- X {
- X! int status;
- X! float fproto;
- X
- X num_object = 0;
- X bzero((char*)obj, COMOBJ_SIZE);
- X! if (fgets(buf,BUF_SIZE,fp)==0) /* version */
- X! return -2;
- X! if (strncmp(buf,"#FIG",4)==0) /* versions 1.4/later have #FIG in first line */
- X! {
- X! if ((sscanf(index(buf,' ')+1,"%f",&fproto))==0) /* assume 1.4 */
- X! proto=14;
- X! else
- X! proto = (fproto+.01)*10; /* protocol version*10 */
- X! status = read_objects(fp, obj);
- X! }
- X! else
- X! {
- X! proto = 13;
- X! status = read_1_3_objects(fp, obj);
- X! }
- X!
- X fclose(fp);
- X return(status);
- X }
- X***************
- X*** 165,171 ****
- X num_object++;
- X break;
- X case O_TEXT :
- X! if ((t = read_textobject()) == NULL) return(-1);
- X if (lt)
- X lt = (lt->next = t);
- X else
- X--- 181,187 ----
- X num_object++;
- X break;
- X case O_TEXT :
- X! if ((t = read_textobject(fp)) == NULL) return(-1);
- X if (lt)
- X lt = (lt->next = t);
- X else
- X***************
- X*** 320,326 ****
- X la = com->arcs = a;
- X break;
- X case O_TEXT :
- X! if ((t = read_textobject()) == NULL) {
- X free_text(&t);
- X return(NULL);
- X }
- X--- 336,342 ----
- X la = com->arcs = a;
- X break;
- X case O_TEXT :
- X! if ((t = read_textobject(fp)) == NULL) {
- X free_text(&t);
- X return(NULL);
- X }
- X***************
- X*** 391,400 ****
- X l->for_arrow = l->back_arrow = NULL;
- X l->next = NULL;
- X
- X! n = sscanf(buf, "%*d%d%d%d%d%d%d%d%f%d%d%d%d",
- X! &l->type, &l->style, &l->thickness, &l->color,
- X! &l->depth, &l->pen, &l->area_fill, &l->style_val, &fa, &ba);
- X! if (n != 10) {
- X put_msg(Err_incomp, "line", line_no);
- X free((char*)l);
- X return(NULL);
- X--- 407,439 ----
- X l->for_arrow = l->back_arrow = NULL;
- X l->next = NULL;
- X
- X! sscanf(buf,"%*d%d",&l->type);
- X! /* 2.0 or later; has separate radius parm for arc-box corners */
- X! if (l->type == T_ARC_BOX && proto >= 20)
- X! {
- X! n = sscanf(buf, "%*d%d%d%d%d%d%d%d%f%d%d%d",
- X! &l->type, &l->style, &l->thickness, &l->color,
- X! &l->depth, &l->pen, &l->area_fill, &l->style_val, &l->radius,
- X! &fa, &ba);
- X! }
- X! /* old format uses pen for radius of arc-box corners */
- X! else
- X! {
- X! n = sscanf(buf, "%*d%d%d%d%d%d%d%d%f%d%d",
- X! &l->type, &l->style, &l->thickness, &l->color,
- X! &l->depth, &l->pen, &l->area_fill, &l->style_val, &fa, &ba);
- X! if (l->type == T_ARC_BOX)
- X! {
- X! l->radius = l->pen;
- X! l->pen = 0;
- X! }
- X! else
- X! l->radius = 0;
- X! }
- X!
- X! if ((proto==14 && n != 10) ||
- X! (proto==20 && (l->type == T_ARC_BOX && n != 11) ||
- X! (l->type != T_ARC_BOX && n != 10))) {
- X put_msg(Err_incomp, "line", line_no);
- X free((char*)l);
- X return(NULL);
- X***************
- X*** 425,431 ****
- X put_msg(Err_mem);
- X return(NULL);
- X }
- X! p->next = NULL; /* as noted by E. Erdem 2/15/90 */
- X if (fscanf(fp, "%d%d", &p->x, &p->y) != 2) {
- X put_msg(Err_incomp, "line", line_no);
- X free_linestorage(l);
- X--- 464,470 ----
- X put_msg(Err_mem);
- X return(NULL);
- X }
- X! p->next = NULL;
- X if (fscanf(fp, "%d%d", &p->x, &p->y) != 2) {
- X put_msg(Err_incomp, "line", line_no);
- X free_linestorage(l);
- X***************
- X*** 576,600 ****
- X }
- X
- X static F_text *
- X! read_textobject()
- X {
- X F_text *t;
- X int n;
- X! char s[BUF_SIZE];
- X
- X Text_malloc(t);
- X t->next = NULL;
- X! n = sscanf(buf,"%*d%d%d%d%d%d%d%f%d%d%d%d%d %[^\1]",
- X &t->type, &t->font, &t->size, &t->pen,
- X &t->color, &t->depth, &t->angle,
- X &t->style, &t->height, &t->length,
- X! &t->base_x, &t->base_y, s);
- X! if (n != 13) {
- X put_msg(Err_incomp, "text", line_no);
- X free((char*)t);
- X! return(NULL);
- X }
- X! if (strlen(s) == 0) /* as noted by E. Erdem 2/15/90 */
- X (void) strcpy(s," ");
- X t->cstring = (char*)calloc((unsigned)(strlen(s)+1), sizeof(char));
- X if (NULL == t->cstring) {
- X--- 615,660 ----
- X }
- X
- X static F_text *
- X! read_textobject(fp)
- X! FILE *fp;
- X {
- X F_text *t;
- X int n;
- X! int ignore = 0;
- X! char s[BUF_SIZE], s_temp[BUF_SIZE], junk[2];
- X
- X Text_malloc(t);
- X t->next = NULL;
- X! /* The text object is terminated by a CONTROL-A, so we read
- X! everything up to the CONTROL-A and then read that character.
- X! If we do not find the CONTROL-A on this line then this must
- X! be a multi-line text object and we will have to read more. */
- X! n = sscanf(buf,"%*d%d%d%d%d%d%d%f%d%d%d%d%d %[^\1]%[\1]",
- X &t->type, &t->font, &t->size, &t->pen,
- X &t->color, &t->depth, &t->angle,
- X &t->style, &t->height, &t->length,
- X! &t->base_x, &t->base_y, s, junk);
- X! if (n != 13 && n != 14) {
- X put_msg(Err_incomp, "text", line_no);
- X free((char*)t);
- X! /* return(NULL); */
- X }
- X! if (n == 13) {
- X! /* Read in the remainder of the text object. */
- X! do {
- X! fgets(buf, BUF_SIZE, fp);
- X! line_no++; /* As is done in get_line */
- X! n = sscanf(buf,"%[^\1]%[\1]", s_temp, junk);
- X! /* Safety check */
- X! if (strlen(s)+1 + strlen(s_temp)+1 > BUF_SIZE) {
- X! /* Too many characters. Ignore the rest. */
- X! ignore = 1;
- X! }
- X! if (!ignore)
- X! strcat(s, s_temp);
- X! } while (n == 1);
- X! }
- X! if (strlen(s) == 0)
- X (void) strcpy(s," ");
- X t->cstring = (char*)calloc((unsigned)(strlen(s)+1), sizeof(char));
- X if (NULL == t->cstring) {
- X***************
- X*** 614,620 ****
- X return(-1);
- X }
- X line_no++;
- X! if (*buf != '#') return(1); /* Skip comment lines */
- X }
- X }
- X
- X--- 674,681 ----
- X return(-1);
- X }
- X line_no++;
- X! if (*buf != '\n' && *buf != '#') /* Skip empty and comment lines */
- X! return(1);
- X }
- X }
- X
- END_OF_FILE
- if test 6773 -ne `wc -c <'read.c.diff'`; then
- echo shar: \"'read.c.diff'\" unpacked with wrong size!
- fi
- # end of 'read.c.diff'
- fi
- if test -f 'ruler.c.diff' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'ruler.c.diff'\"
- else
- echo shar: Extracting \"'ruler.c.diff'\" \(6987 characters\)
- sed "s/^X//" >'ruler.c.diff' <<'END_OF_FILE'
- X*** ruler.c.old Tue Apr 24 11:48:38 1990
- X--- ruler.c Mon Apr 16 11:36:36 1990
- X***************
- X*** 33,41 ****
- X
- X static lasty = -100;
- X static lastx = -100;
- X- static int start;
- X- static char *number[] = {"0", "1", "2", "3", "4", "5",
- X- "6", "7", "8", "9", "10", "11" };
- X static int troffx = -7, troffy = -10;
- X static char tr_marker_image[16] = {
- X 0xFE, 0xFF, /* *************** */
- X--- 33,38 ----
- X***************
- X*** 95,104 ****
- X set_toprulermark(x)
- X int x;
- X {
- X! XClearArea(tool_d, topruler_pixwin,lastx + troffx,
- X TOPRULER_HEIGHT + troffy,trm_pr.width,
- X trm_pr.height, False);
- X! XCopyArea(tool_d, toparrow_pm, topruler_pixwin, topgc,
- X 0, 0, trm_pr.width, trm_pr.height,
- X x + troffx, TOPRULER_HEIGHT + troffy);
- X lastx = x;
- X--- 92,101 ----
- X set_toprulermark(x)
- X int x;
- X {
- X! XClearArea(tool_d, topruler_win,lastx + troffx,
- X TOPRULER_HEIGHT + troffy,trm_pr.width,
- X trm_pr.height, False);
- X! XCopyArea(tool_d, toparrow_pm, topruler_win, topgc,
- X 0, 0, trm_pr.width, trm_pr.height,
- X x + troffx, TOPRULER_HEIGHT + troffy);
- X lastx = x;
- X***************
- X*** 145,151 ****
- X
- X redisplay_sideruler()
- X {
- X! XClearWindow(tool_d, sideruler_pixwin);
- X }
- X
- X int
- X--- 142,148 ----
- X
- X redisplay_sideruler()
- X {
- X! XClearWindow(tool_d, sideruler_win);
- X }
- X
- X int
- X***************
- X*** 170,176 ****
- X
- X redisplay_topruler()
- X {
- X! XClearWindow(tool_d, topruler_pixwin);
- X }
- X
- X setup_rulers()
- X--- 167,173 ----
- X
- X redisplay_topruler()
- X {
- X! XClearWindow(tool_d, topruler_win);
- X }
- X
- X setup_rulers()
- X***************
- X*** 183,201 ****
- X #define TWOMM (PIX_PER_CM / 5)
- X char number[3];
- X Arg tmp_arg[3];
- X! long bg, fg;
- X static Arg ruler_args[] =
- X {
- X { XtNbackgroundPixmap, (XtArgVal)NULL },
- X };
- X
- X! topruler_pixwin = trswfd = XtWindow(topruler_sw);
- X! sideruler_pixwin = srswfd = XtWindow(sideruler_sw);
- X! XDefineCursor(tool_d, trswfd, (Cursor)bull_cursor.bitmap);
- X! XDefineCursor(tool_d, srswfd, (Cursor)bull_cursor.bitmap);
- X
- X /* top ruler, adjustments for digits are kludges based on 6x13 char */
- X! p = XCreatePixmap(tool_d, topruler_pixwin,
- X TOPRULER_WIDTH, TOPRULER_HEIGHT,
- X DefaultDepthOfScreen(tool_s));
- X
- X--- 180,198 ----
- X #define TWOMM (PIX_PER_CM / 5)
- X char number[3];
- X Arg tmp_arg[3];
- X! unsigned long bg, fg;
- X static Arg ruler_args[] =
- X {
- X { XtNbackgroundPixmap, (XtArgVal)NULL },
- X };
- X
- X! topruler_win = XtWindow(topruler_sw);
- X! sideruler_win = XtWindow(sideruler_sw);
- X! XDefineCursor(tool_d, topruler_win, (Cursor)bull_cursor.bitmap);
- X! XDefineCursor(tool_d, sideruler_win, (Cursor)bull_cursor.bitmap);
- X
- X /* top ruler, adjustments for digits are kludges based on 6x13 char */
- X! p = XCreatePixmap(tool_d, topruler_win,
- X TOPRULER_WIDTH, TOPRULER_HEIGHT,
- X DefaultDepthOfScreen(tool_s));
- X
- X***************
- X*** 267,273 ****
- X XSetBackground(tool_d, gc, 0);
- X
- X /* make pixmaps for top ruler arrow */
- X! toparrow_pm = XCreatePixmap(tool_d, topruler_pixwin, trm_pr.width,
- X trm_pr.height,
- X DefaultDepthOfScreen(tool_s));
- X XPutImage(tool_d, toparrow_pm, gc, &trm_pr, 0, 0, 0, 0,
- X--- 264,270 ----
- X XSetBackground(tool_d, gc, 0);
- X
- X /* make pixmaps for top ruler arrow */
- X! toparrow_pm = XCreatePixmap(tool_d, topruler_win, trm_pr.width,
- X trm_pr.height,
- X DefaultDepthOfScreen(tool_s));
- X XPutImage(tool_d, toparrow_pm, gc, &trm_pr, 0, 0, 0, 0,
- X***************
- X*** 274,280 ****
- X trm_pr.width, trm_pr.height);
- X
- X /* side ruler, adjustments for digits are kludges based on 6x13 char */
- X! p = XCreatePixmap(tool_d, sideruler_pixwin,
- X SIDERULER_WIDTH, SIDERULER_HEIGHT,
- X DefaultDepthOfScreen(tool_s));
- X XtSetArg(tmp_arg[0], XtNbackground, &bg);
- X--- 271,277 ----
- X trm_pr.width, trm_pr.height);
- X
- X /* side ruler, adjustments for digits are kludges based on 6x13 char */
- X! p = XCreatePixmap(tool_d, sideruler_win,
- X SIDERULER_WIDTH, SIDERULER_HEIGHT,
- X DefaultDepthOfScreen(tool_s));
- X XtSetArg(tmp_arg[0], XtNbackground, &bg);
- X***************
- X*** 388,394 ****
- X /* make pixmaps for side ruler arrow */
- X if( appres.RHS_PANEL )
- X {
- X! sidearrow_pm = XCreatePixmap(tool_d, sideruler_pixwin,
- X srlm_pr.width, srlm_pr.height,
- X DefaultDepthOfScreen(tool_s));
- X XPutImage(tool_d, sidearrow_pm, gc, &srlm_pr, 0, 0, 0, 0,
- X--- 385,391 ----
- X /* make pixmaps for side ruler arrow */
- X if( appres.RHS_PANEL )
- X {
- X! sidearrow_pm = XCreatePixmap(tool_d, sideruler_win,
- X srlm_pr.width, srlm_pr.height,
- X DefaultDepthOfScreen(tool_s));
- X XPutImage(tool_d, sidearrow_pm, gc, &srlm_pr, 0, 0, 0, 0,
- X***************
- X*** 396,402 ****
- X }
- X else
- X {
- X! sidearrow_pm = XCreatePixmap(tool_d, sideruler_pixwin,
- X srrm_pr.width, srrm_pr.height,
- X DefaultDepthOfScreen(tool_s));
- X XPutImage(tool_d, sidearrow_pm, gc, &srrm_pr, 0, 0, 0, 0,
- X--- 393,399 ----
- X }
- X else
- X {
- X! sidearrow_pm = XCreatePixmap(tool_d, sideruler_win,
- X srrm_pr.width, srrm_pr.height,
- X DefaultDepthOfScreen(tool_s));
- X XPutImage(tool_d, sidearrow_pm, gc, &srrm_pr, 0, 0, 0, 0,
- X***************
- X*** 423,437 ****
- X set_siderulermark(y)
- X int y;
- X {
- X- int sy;
- X-
- X if( appres.RHS_PANEL ) {
- X /* Because the ruler uses a background pixmap, we can win
- X here by using XClearArea to erase the old thing. */
- X! XClearArea(tool_d, sideruler_pixwin,
- X RULER_WIDTH+srloffx, lasty + srloffy,
- X srlm_pr.width, srlm_pr.height, False);
- X! XCopyArea(tool_d, sidearrow_pm, sideruler_pixwin,
- X sidegc, 0, 0, srlm_pr.width,
- X srlm_pr.height, RULER_WIDTH+srloffx, y + srloffy);
- X }
- X--- 420,432 ----
- X set_siderulermark(y)
- X int y;
- X {
- X if( appres.RHS_PANEL ) {
- X /* Because the ruler uses a background pixmap, we can win
- X here by using XClearArea to erase the old thing. */
- X! XClearArea(tool_d, sideruler_win,
- X RULER_WIDTH+srloffx, lasty + srloffy,
- X srlm_pr.width, srlm_pr.height, False);
- X! XCopyArea(tool_d, sidearrow_pm, sideruler_win,
- X sidegc, 0, 0, srlm_pr.width,
- X srlm_pr.height, RULER_WIDTH+srloffx, y + srloffy);
- X }
- X***************
- X*** 439,448 ****
- X {
- X /* Because the ruler uses a background pixmap, we can win
- X here by using XClearArea to erase the old thing. */
- X! XClearArea(tool_d, sideruler_pixwin,
- X srroffx, lasty + srroffy,
- X srlm_pr.width, srlm_pr.height, False);
- X! XCopyArea(tool_d, sidearrow_pm, sideruler_pixwin,
- X sidegc, 0, 0, srrm_pr.width,
- X srrm_pr.height, srroffx, y + srroffy);
- X }
- X--- 434,443 ----
- X {
- X /* Because the ruler uses a background pixmap, we can win
- X here by using XClearArea to erase the old thing. */
- X! XClearArea(tool_d, sideruler_win,
- X srroffx, lasty + srroffy,
- X srlm_pr.width, srlm_pr.height, False);
- X! XCopyArea(tool_d, sidearrow_pm, sideruler_win,
- X sidegc, 0, 0, srrm_pr.width,
- X srrm_pr.height, srroffx, y + srroffy);
- X }
- END_OF_FILE
- if test 6987 -ne `wc -c <'ruler.c.diff'`; then
- echo shar: \"'ruler.c.diff'\" unpacked with wrong size!
- fi
- # end of 'ruler.c.diff'
- fi
- if test -f 'text.c.diff' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'text.c.diff'\"
- else
- echo shar: Extracting \"'text.c.diff'\" \(5047 characters\)
- sed "s/^X//" >'text.c.diff' <<'END_OF_FILE'
- X*** text.c.old Tue Apr 24 11:48:41 1990
- X--- text.c Mon Apr 16 11:26:13 1990
- X***************
- X*** 38,44 ****
- X extern int leng_prefix, leng_suffix;
- X extern int cur_color;
- X extern int cur_textstyle;
- X! extern int cur_texttype;
- X extern float cur_angle;
- X
- X extern F_compound objects;
- X--- 38,44 ----
- X extern int leng_prefix, leng_suffix;
- X extern int cur_color;
- X extern int cur_textstyle;
- X! extern int cur_textjust;
- X extern float cur_angle;
- X
- X extern F_compound objects;
- X***************
- X*** 115,122 ****
- X init_text_input(x, y)
- X int x, y;
- X {
- X! int abasex, basx;
- X! int twidth,pwidth;
- X
- X cur_x = x;
- X cur_y = y;
- X--- 115,121 ----
- X init_text_input(x, y)
- X int x, y;
- X {
- X! int basx;
- X
- X cur_x = x;
- X cur_y = y;
- X***************
- X*** 130,136 ****
- X /* set current font info to indicator button settings */
- X cur_fontsize = size_button;
- X cur_font = font_button;
- X! cur_texttype = type_button;
- X
- X /* load the X font and get its id for this font, size */
- X canvas_font = lookfont(cur_font, cur_fontsize);
- X--- 129,135 ----
- X /* set current font info to indicator button settings */
- X cur_fontsize = size_button;
- X cur_font = font_button;
- X! cur_textjust = type_button;
- X
- X /* load the X font and get its id for this font, size */
- X canvas_font = lookfont(cur_font, cur_fontsize);
- X***************
- X*** 141,155 ****
- X leng_prefix = leng_suffix = 0;
- X *suffix = 0;
- X prefix[leng_prefix] = '\0';
- X! abasex = base_x = cur_x;
- X base_y = cur_y;
- X- twidth = 0;
- X- pwidth = 0;
- X }
- X else { /* clicked on existing text */
- X /* leng_prefix is # of char in the text before the cursor */
- X leng_suffix = strlen(cur_text->cstring);
- X! abasex = basx = cur_text->base_x;
- X if (cur_text->type == T_CENTER_JUSTIFIED)
- X basx -= cur_text->length/2;
- X else if (cur_text->type == T_RIGHT_JUSTIFIED)
- X--- 140,152 ----
- X leng_prefix = leng_suffix = 0;
- X *suffix = 0;
- X prefix[leng_prefix] = '\0';
- X! base_x = cur_x;
- X base_y = cur_y;
- X }
- X else { /* clicked on existing text */
- X /* leng_prefix is # of char in the text before the cursor */
- X leng_suffix = strlen(cur_text->cstring);
- X! basx = cur_text->base_x;
- X if (cur_text->type == T_CENTER_JUSTIFIED)
- X basx -= cur_text->length/2;
- X else if (cur_text->type == T_RIGHT_JUSTIFIED)
- X***************
- X*** 160,175 ****
- X strcpy(suffix, &cur_text->cstring[leng_prefix]);
- X tsize = pf_textwidth(cur_text->font, cur_text->size, leng_prefix, prefix);
- X ssize = pf_textwidth(cur_text->font, cur_text->size, leng_suffix, suffix);
- X- pwidth = tsize.x; /* pixel width of prefix */
- X- twidth = pwidth+ssize.x; /* total pixel width of string */
- X cur_x = base_x = basx;
- X cur_y = base_y = cur_text->base_y;
- X cur_x += tsize.x;
- X cur_font = cur_text->font;
- X cur_fontsize = cur_text->size;
- X! cur_texttype = cur_text->type;
- X }
- X! initialize_char_handler(canvas_pixwin, finish_text_input,
- X base_x, base_y);
- X }
- X
- X--- 157,170 ----
- X strcpy(suffix, &cur_text->cstring[leng_prefix]);
- X tsize = pf_textwidth(cur_text->font, cur_text->size, leng_prefix, prefix);
- X ssize = pf_textwidth(cur_text->font, cur_text->size, leng_suffix, suffix);
- X cur_x = base_x = basx;
- X cur_y = base_y = cur_text->base_y;
- X cur_x += tsize.x;
- X cur_font = cur_text->font;
- X cur_fontsize = cur_text->size;
- X! cur_textjust = cur_text->type;
- X }
- X! initialize_char_handler(canvas_win, finish_text_input,
- X base_x, base_y);
- X }
- X
- X***************
- X*** 197,203 ****
- X return(NULL);
- X }
- X text->cstring = calloc((unsigned)(leng_prefix+1), sizeof(char));
- X! text->type = cur_texttype;;
- X text->font = cur_font; /* put in current font number */
- X text->size = cur_fontsize; /* added 9/25/89 B.V.Smith */
- X text->angle = cur_angle;
- X--- 192,198 ----
- X return(NULL);
- X }
- X text->cstring = calloc((unsigned)(leng_prefix+1), sizeof(char));
- X! text->type = cur_textjust;;
- X text->font = cur_font; /* put in current font number */
- X text->size = cur_fontsize; /* added 9/25/89 B.V.Smith */
- X text->angle = cur_angle;
- X***************
- X*** 204,210 ****
- X text->style = cur_textstyle;
- X text->color = cur_color;
- X text->depth = 0;
- X! text->pen = NULL;
- X size = pf_textwidth(text->font, text->size, leng_prefix, prefix);
- X text->length = size.x; /* in pixels */
- X text->height = size.y; /* in pixels */
- X--- 199,205 ----
- X text->style = cur_textstyle;
- X text->color = cur_color;
- X text->depth = 0;
- X! text->pen = 0;
- X size = pf_textwidth(text->font, text->size, leng_prefix, prefix);
- X text->length = size.x; /* in pixels */
- X text->height = size.y; /* in pixels */
- X***************
- X*** 277,282 ****
- X else
- X x -= size.x;
- X }
- X! pw_text(canvas_pixwin, x, text->base_y,
- X op, text->font, text->size, text->cstring);
- X }
- X--- 272,277 ----
- X else
- X x -= size.x;
- X }
- X! pw_text(canvas_win, x, text->base_y,
- X op, text->font, text->size, text->cstring);
- X }
- END_OF_FILE
- if test 5047 -ne `wc -c <'text.c.diff'`; then
- echo shar: \"'text.c.diff'\" unpacked with wrong size!
- fi
- # end of 'text.c.diff'
- fi
- if test -f 'xtra.c.diff' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'xtra.c.diff'\"
- else
- echo shar: Extracting \"'xtra.c.diff'\" \(7309 characters\)
- sed "s/^X//" >'xtra.c.diff' <<'END_OF_FILE'
- X*** xtra.c.old Tue Apr 24 11:48:47 1990
- X--- xtra.c Wed Apr 18 09:43:06 1990
- X***************
- X*** 13,19 ****
- X #include "font.h"
- X #include "object.h"
- X
- X! extern int gc_thickness[], gc_line_style[];
- X
- X extern PIX_FONT lookfont();
- X
- X--- 13,19 ----
- X #include "font.h"
- X #include "object.h"
- X
- X! extern int gc_thickness[0x10], gc_line_style[0x10];
- X
- X extern PIX_FONT lookfont();
- X
- X***************
- X*** 58,85 ****
- X {
- X register GC ngc;
- X XGCValues gcv;
- X! int gcmask;
- X
- X gcv.font = roman_font->fid;
- X gcv.join_style = JoinMiter;
- X gcmask = GCJoinStyle|GCFunction|GCForeground|GCBackground|GCFont;
- X switch (op) {
- X! case PAINT:
- X gcv.foreground = fg;
- X gcv.background = bg;
- X gcv.function = GXcopy;
- X break;
- X! case ERASE:
- X gcv.foreground = bg;
- X gcv.background = bg;
- X gcv.function = GXcopy;
- X break;
- X! case INV_PAINT:
- X gcv.foreground = fg ^ bg;
- X gcv.background = bg;
- X gcv.function = GXxor;
- X break;
- X! case MERGE:
- X gcv.foreground = fg;
- X gcv.background = bg;
- X gcv.function = GXor;
- X--- 58,85 ----
- X {
- X register GC ngc;
- X XGCValues gcv;
- X! unsigned long gcmask;
- X
- X gcv.font = roman_font->fid;
- X gcv.join_style = JoinMiter;
- X gcmask = GCJoinStyle|GCFunction|GCForeground|GCBackground|GCFont;
- X switch (op) {
- X! case PAINT:
- X gcv.foreground = fg;
- X gcv.background = bg;
- X gcv.function = GXcopy;
- X break;
- X! case ERASE:
- X gcv.foreground = bg;
- X gcv.background = bg;
- X gcv.function = GXcopy;
- X break;
- X! case INV_PAINT:
- X gcv.foreground = fg ^ bg;
- X gcv.background = bg;
- X gcv.function = GXxor;
- X break;
- X! case MERGE:
- X gcv.foreground = fg;
- X gcv.background = bg;
- X gcv.function = GXor;
- X***************
- X*** 125,130 ****
- X--- 125,153 ----
- X sidegc = makegc(INV_PAINT, fg, bg);
- X }
- X
- X+ /* create the gc's for area fill (PAINT and ERASE) */
- X+ /* the fill_pm[] and unfill_pm[] must already be created */
- X+
- X+ init_fill_gc()
- X+ {
- X+ XGCValues gcv;
- X+ int i;
- X+
- X+ gcv.fill_style = FillOpaqueStippled;
- X+ gcv.arc_mode = ArcPieSlice; /* fill mode for arcs */
- X+ gcv.fill_rule = EvenOddRule/*WindingRule*/;
- X+ for (i=0; i<NUMFILLPATS; i++)
- X+ {
- X+ fill_gc[i] = makegc(PAINT, x_fg_color.pixel, x_bg_color.pixel);
- X+ un_fill_gc[i] = makegc(ERASE, x_fg_color.pixel, x_bg_color.pixel);
- X+ gcv.stipple = fill_pm[i];
- X+ XChangeGC(tool_d, fill_gc[i],
- X+ GCStipple|GCFillStyle|GCFillRule|GCArcMode, &gcv);
- X+ XChangeGC(tool_d, un_fill_gc[i],
- X+ GCStipple|GCFillStyle|GCArcMode, &gcv);
- X+ }
- X+ }
- X+
- X /* grey images for fill patterns */
- X
- X #ifndef TFX
- X***************
- X*** 161,198 ****
- X };
- X #endif
- X
- X- /* create the gc's for area fill (PAINT and ERASE) */
- X
- X! init_fill_gc()
- X {
- X- XGCValues gcv;
- X int i;
- X
- X- gcv.fill_style = FillOpaqueStippled;
- X- gcv.arc_mode = ArcPieSlice; /* fill mode for arcs */
- X- gcv.fill_rule = EvenOddRule/*WindingRule*/;
- X for (i=0; i<NUMFILLPATS; i++)
- X! {
- X! /* if we want the area fill to be "meshed" on top of existing
- X! filled objects, then we must use stippling. This means
- X! creating a one-plane bitmap and setting the stipple part
- X! of the gc and selecting stipple fill mode.
- X! */
- X! fill_pm[i] = XCreateBitmapFromData(tool_d, XtWindow(canvas_sw),
- X! fill_images[i],8,8);
- X! /* create pixmaps of area-fill colors for indicator */
- X! ind_fill_pm[i] = XCreatePixmapFromBitmapData(tool_d, XtWindow(canvas_sw),
- X! fill_images[i],8,8,
- X! x_fg_color.pixel,x_bg_color.pixel,
- X! DefaultDepthOfScreen(tool_s));
- X! fill_gc[i] = makegc(PAINT, x_fg_color.pixel, x_bg_color.pixel);
- X! un_fill_gc[i] = makegc(ERASE, x_fg_color.pixel, x_bg_color.pixel);
- X! gcv.stipple = fill_pm[i];
- X! XChangeGC(tool_d, fill_gc[i],
- X! GCStipple|GCFillStyle|GCFillRule|GCArcMode, &gcv);
- X! XChangeGC(tool_d, un_fill_gc[i],
- X! GCStipple|GCFillStyle|GCArcMode, &gcv);
- X! }
- X }
- X
- X /*
- X--- 184,207 ----
- X };
- X #endif
- X
- X
- X! /* generate the fill pixmaps */
- X!
- X! init_fill_pm()
- X {
- X int i;
- X
- X for (i=0; i<NUMFILLPATS; i++)
- X! {
- X! fill_pm[i] = XCreateBitmapFromData(tool_d, XtWindow(canvas_sw),
- X! fill_images[i],8,8);
- X! /* create pixmaps of area-fill colors for indicator */
- X! ind_fill_pm[i] = XCreatePixmapFromBitmapData(tool_d,
- X! XtWindow(canvas_sw),
- X! fill_images[i],8,8,
- X! x_fg_color.pixel,x_bg_color.pixel,
- X! DefaultDepthOfScreen(tool_s));
- X! }
- X }
- X
- X /*
- X***************
- X*** 201,207 ****
- X ** the users consent, so maybe the original code is wrong?
- X */
- X win_setmouseposition(w,x,y)
- X! FDTYPE w;
- X int x, y;
- X {
- X }
- X--- 210,216 ----
- X ** the users consent, so maybe the original code is wrong?
- X */
- X win_setmouseposition(w,x,y)
- X! Window w;
- X int x, y;
- X {
- X }
- X***************
- X*** 266,283 ****
- X char buf[1];
- X XWindowAttributes attr;
- X
- X! XClearArea(tool_d, msgswfd, 0, 0, 0, 0, False);
- X /* uses knowledge that msg_gccache[PAINT] uses roman_font - tsk */
- X len = strlen(prompt);
- X width = char_width(roman_font);
- X y = char_height(roman_font) + 2;
- X! XDrawString(tool_d, msgswfd, msg_gccache[PAINT], 2, y, prompt, len);
- X x = width * len + 4;
- X! XGetWindowAttributes(tool_d, msgswfd, &attr);
- X! XSelectInput(tool_d, msgswfd, attr.your_event_mask | KeyPressMask);
- X for (;;)
- X {
- X! XWindowEvent(tool_d, msgswfd, KeyPressMask, &event);
- X if (event.type != KeyPress)
- X continue;
- X if (XLookupString(ke, buf, sizeof(buf), NULL, NULL) <= 0)
- X--- 275,292 ----
- X char buf[1];
- X XWindowAttributes attr;
- X
- X! XClearArea(tool_d, msg_win, 0, 0, 0, 0, False);
- X /* uses knowledge that msg_gccache[PAINT] uses roman_font - tsk */
- X len = strlen(prompt);
- X width = char_width(roman_font);
- X y = char_height(roman_font) + 2;
- X! XDrawString(tool_d, msg_win, msg_gccache[PAINT], 2, y, prompt, len);
- X x = width * len + 4;
- X! XGetWindowAttributes(tool_d, msg_win, &attr);
- X! XSelectInput(tool_d, msg_win, attr.your_event_mask | KeyPressMask);
- X for (;;)
- X {
- X! XWindowEvent(tool_d, msg_win, KeyPressMask, &event);
- X if (event.type != KeyPress)
- X continue;
- X if (XLookupString(ke, buf, sizeof(buf), NULL, NULL) <= 0)
- X***************
- X*** 290,296 ****
- X {
- X x -= width;
- X --r;
- X! XDrawString(tool_d, msgswfd, msg_gccache[ERASE],
- X x, y, r, 1);
- X }
- X break;
- X--- 299,305 ----
- X {
- X x -= width;
- X --r;
- X! XDrawString(tool_d, msg_win, msg_gccache[ERASE],
- X x, y, r, 1);
- X }
- X break;
- X***************
- X*** 300,306 ****
- X {
- X x -= width;
- X --r;
- X! XDrawString(tool_d, msgswfd, msg_gccache[ERASE],
- X x, y, r, 1);
- X }
- X break;
- X--- 309,315 ----
- X {
- X x -= width;
- X --r;
- X! XDrawString(tool_d, msg_win, msg_gccache[ERASE],
- X x, y, r, 1);
- X }
- X break;
- X***************
- X*** 307,318 ****
- X case CR:
- X case NL:
- X *r = '\0';
- X! XClearArea(tool_d, msgswfd, 0, 0, 0, 0, False);
- X return;
- X default:
- X if (buf[0] < ' ' || buf[0] > '~')
- X continue;
- X! XDrawString(tool_d, msgswfd, msg_gccache[PAINT],
- X x, y, buf, 1);
- X x += width;
- X *r++ = buf[0];
- X--- 316,327 ----
- X case CR:
- X case NL:
- X *r = '\0';
- X! XClearArea(tool_d, msg_win, 0, 0, 0, 0, False);
- X return;
- X default:
- X if (buf[0] < ' ' || buf[0] > '~')
- X continue;
- X! XDrawString(tool_d, msg_win, msg_gccache[PAINT],
- X x, y, buf, 1);
- X x += width;
- X *r++ = buf[0];
- END_OF_FILE
- if test 7309 -ne `wc -c <'xtra.c.diff'`; then
- echo shar: \"'xtra.c.diff'\" unpacked with wrong size!
- fi
- # end of 'xtra.c.diff'
- fi
- echo shar: End of archive 3 \(of 6\).
- cp /dev/null ark3isdone
- MISSING=""
- for I in 1 2 3 4 5 6 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 6 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
- dan
- -----------------------------------------------------------
- O'Reilly && Associates
- argv@sun.com / argv@ora.com
- 632 Petaluma Ave, Sebastopol, CA 95472
- 800-338-NUTS, in CA: 800-533-NUTS, FAX 707-829-0104
- Opinions expressed reflect those of the author only.
-